<?php

class Scroller_model extends CI_Model {
	
	function __construct()	{
      parent::__construct();
   }
	
	public function event() {
		$this->load->database();
		$this->db->select('*');
		$this->db->from('event');
		$this->db->join('members', 'event.postId = members.id');
		$this->db->order_by("id", "desc");
		$this->db->limit(3);
		$query = $this->db->get();
		return $query->result();
	}
   
	public function achieve() {
		$this->load->database();
		$this->db->select('*');
		$this->db->from('achievement');
		$this->db->join('members', 'achievement.memId = members.id');
		$this->db->join('dept', 'members.dept = dept.deptId');
		$this->db->order_by("id", "desc");
		$this->db->limit(3);
		$query = $this->db->get();
		return $query->result();
	}
}

